package com.example.demo.design.command;

import java.util.ArrayList;

/**
 * @Author: liull
 * @Description: “功能键设置”界面类
 * @Date: Created in 11:18 2021/4/6
 * @Modified By:
 */
public class FBSettingWindow {
    // 窗口标题
    private String title;

    private ArrayList<FunctionButton> functionButtons = new ArrayList<>();

    public FBSettingWindow(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void addFunctionButton(FunctionButton fb) {
        functionButtons.add(fb);
    }

    public void removeFunctionButton(FunctionButton fb) {
        functionButtons.remove(fb);
    }

    public void display() {
        System.out.println("显示窗口：" + this.title);
        System.out.println("显示功能键：");
        for (FunctionButton button : functionButtons) {
            System.out.println(button.getName());
        }
        System.out.println("------------------------------------");
    }
}
